Add CnyExternalAccountCreateInfo + register in CreateInfo OneOf#552
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript ✅ grid-typescript studio · code
✅ grid-ruby studio · code
|
Greptile SummaryThis PR adds the missing
Confidence Score: 5/5Safe to merge — adds a well-scoped, missing schema file and its OneOf registration with no changes to existing entries. The change is additive only: a new YAML file and two new lines in the OneOf registration. All $ref targets exist and resolve. The discriminator mapping entry is present and alphabetically ordered. No existing schemas or endpoints are modified. No files require special attention.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/external_accounts/CnyExternalAccountCreateInfo.yaml | New CNY create-side schema, correctly mirrors BdtExternalAccountCreateInfo.yaml with CNY-specific refs; all referenced schemas exist and resolve |
| openapi/components/schemas/external_accounts/ExternalAccountCreateInfoOneOf.yaml | Adds CnyExternalAccountCreateInfo to both the oneOf array and the discriminator.mapping block; CNY_ACCOUNT entry correctly placed alphabetically |
| openapi.yaml | Regenerated bundle reflecting the new CnyExternalAccountCreateInfo schema and OneOf registration |
| mintlify/openapi.yaml | Mintlify bundle regenerated to include CnyExternalAccountCreateInfo for docs |
Sequence Diagram
sequenceDiagram
participant Client
participant API as POST /customers/external-accounts
participant Discriminator as ExternalAccountCreateInfoOneOf
participant Schema as CnyExternalAccountCreateInfo
Client->>API: "{ accountType: "CNY_ACCOUNT", ... }"
API->>Discriminator: resolve oneOf via discriminator
Discriminator->>Schema: "mapping["CNY_ACCOUNT"] -> CnyExternalAccountCreateInfo.yaml"
Schema->>Schema: "allOf [BaseExternalAccountInfo, CnyAccountInfoBase, {beneficiary}]"
Schema-->>API: validated
API-->>Client: 200 OK
Reviews (2): Last reviewed commit: "Add CnyExternalAccountCreateInfo + regis..." | Re-trigger Greptile
The auto-sync workflow's create_external_accounts.py only generates
the read-side `{Currency}ExternalAccountInfo.yaml`; the create-side
`{Currency}ExternalAccountCreateInfo.yaml` is hand-authored per
corridor and was missed when CNY landed via #551. Without the Create
variant in `ExternalAccountCreateInfoOneOf`, the discriminator can't
dispatch `accountType: CNY_ACCOUNT` on POST /customers/external-
accounts and the request fails with "did not match any expected shape".
This adds the missing schema (mirroring the existing
BdtExternalAccountCreateInfo template) and inserts the $ref in the
CreateInfoOneOf alphabetically between Cad and Cop.
519bcee to
4451e8b
Compare
|
Good catch — fixed in 4451e8b. Added |
## Summary - Add `CNY_ACCOUNT` to Grid Visualizer data files (`account-types.ts`, `currencies.ts`) - Move China from "Coming Soon" to supported countries in `country-support.mdx` - Update Asia-Pacific region count from 9 to 10 countries Syncs documentation and visualizer with CNY_ACCOUNT addition in #552. ## Test plan - [ ] Grid Visualizer renders CNY as a fiat destination option - [ ] Country support table shows China with `Bank Transfer` rail - [ ] Regional summary shows 10 countries for Asia-Pacific 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
CnyExternalAccountCreateInfo.yaml(hand-authored, mirrors the existingBdtExternalAccountCreateInfo.yamltemplate) and registers it inExternalAccountCreateInfoOneOf.yaml.create_external_accounts.pyonly generates the read-side{Currency}ExternalAccountInfo.yaml; the create-side{Currency}ExternalAccountCreateInfo.yamlis hand-authored per corridor and was missed when CNY landed via chore: Sync account schemas #551. Without the create variant in the OneOf, the discriminator can't dispatchaccountType: CNY_ACCOUNTonPOST /customers/external-accountsand the request fails with"did not match any expected shape".Test plan
npm run build:openapiproduces a bundle that containsCnyExternalAccountCreateInfo(line 15259 in the regeneratedopenapi.yaml).update_schema.shand confirmgrid_api/models/cny_external_account_create_info.pyexists.